<template>
  <el-dialog
    :title="!dataForm.id ? '新增' : '修改'"
    :close-on-click-modal="false"
    :visible.sync="visible">
    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
      <el-form-item label="商品所属商品分类ID，取值CATEGORY的ID(数字0：未插入)" prop="catId">
        <el-input v-model="dataForm.catId" placeholder="商品所属商品分类ID，取值CATEGORY的ID(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="品牌ID，取值于BRAND 的BRAND_ID(数字0：未插入)" prop="brandId">
        <el-input v-model="dataForm.brandId" placeholder="品牌ID，取值于BRAND 的BRAND_ID(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="商家ID即组织ID即店铺ID即卖家ID(数字0：未插入)" prop="userId">
        <el-input v-model="dataForm.userId" placeholder="商家ID即组织ID即店铺ID即卖家ID(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="商品的唯一货号(字符串空：未插入)" prop="goodsSn">
        <el-input v-model="dataForm.goodsSn" placeholder="商品的唯一货号(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="商品的名称(字符串空：未插入)" prop="goodsName">
        <el-input v-model="dataForm.goodsName" placeholder="商品的名称(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="是否是实物；比如虚拟卡不是实物(数字0：未插入，1.是,2：否，)" prop="isReal">
        <el-input v-model="dataForm.isReal" placeholder="是否是实物；比如虚拟卡不是实物(数字0：未插入，1.是,2：否，)"></el-input>
      </el-form-item>
      <el-form-item label="商品的简短描述(字符串空：未插入)" prop="goodsBrief">
        <el-input v-model="dataForm.goodsBrief" placeholder="商品的简短描述(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="商品的详细描述(字符串空：未插入)" prop="goodsDesc">
        <el-input v-model="dataForm.goodsDesc" placeholder="商品的详细描述(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="商品在前台显示的微缩图片，如在分类筛选时显示的小图片(字符串空：未插入)" prop="goodsThumb">
        <el-input v-model="dataForm.goodsThumb" placeholder="商品在前台显示的微缩图片，如在分类筛选时显示的小图片(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="商品的实际大小图片，如进入该商品页时介绍商品属性所显示的大图片(字符串空：未插入)" prop="goodsImg">
        <el-input v-model="dataForm.goodsImg" placeholder="商品的实际大小图片，如进入该商品页时介绍商品属性所显示的大图片(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="上传的商品的原始图片(字符串空：未插入)" prop="originalImg">
        <el-input v-model="dataForm.originalImg" placeholder="上传的商品的原始图片(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="商品的产地(字符串空：未插入)" prop="goodsAdress">
        <el-input v-model="dataForm.goodsAdress" placeholder="商品的产地(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="商品的规格(字符串空：未插入)" prop="goodsFormat">
        <el-input v-model="dataForm.goodsFormat" placeholder="商品的规格(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="商品的城市；只有培训会有城市，且需要城市字典表用于前段显示(字符串空：未插入)" prop="goodsCity">
        <el-input v-model="dataForm.goodsCity" placeholder="商品的城市；只有培训会有城市，且需要城市字典表用于前段显示(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="商品的重量，以千克为单位(数字0：未插入)" prop="goodsWeight">
        <el-input v-model="dataForm.goodsWeight" placeholder="商品的重量，以千克为单位(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="商品库存数量(数字0：未插入，1.是,2：否，)" prop="goodsNumber">
        <el-input v-model="dataForm.goodsNumber" placeholder="商品库存数量(数字0：未插入，1.是,2：否，)"></el-input>
      </el-form-item>
      <el-form-item label="该商品是否开放销售(数字0：未插入，1.是,2：否，)" prop="isOnSale">
        <el-input v-model="dataForm.isOnSale" placeholder="该商品是否开放销售(数字0：未插入，1.是,2：否，)"></el-input>
      </el-form-item>
      <el-form-item label="是否能单独销售；如果不能单独销售，则只能作为某商品的配件或者赠品销售(数字0：未插入，1.是,2：否，)" prop="isAloneSale">
        <el-input v-model="dataForm.isAloneSale" placeholder="是否能单独销售；如果不能单独销售，则只能作为某商品的配件或者赠品销售(数字0：未插入，1.是,2：否，)"></el-input>
      </el-form-item>
      <el-form-item label="市场售价(数字0：未插入)" prop="marketPrice">
        <el-input v-model="dataForm.marketPrice" placeholder="市场售价(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="本店售价(数字0：未插入)" prop="shopPrice">
        <el-input v-model="dataForm.shopPrice" placeholder="本店售价(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="会员售价(数字0：未插入)" prop="memberPrice">
        <el-input v-model="dataForm.memberPrice" placeholder="会员售价(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="是否特价促销(数字0：未插入，1.是,2：否，)" prop="isPromote">
        <el-input v-model="dataForm.isPromote" placeholder="是否特价促销(数字0：未插入，1.是,2：否，)"></el-input>
      </el-form-item>
      <el-form-item label="促销价格开始日期(数字0：未插入)" prop="promoteStartUtc">
        <el-input v-model="dataForm.promoteStartUtc" placeholder="促销价格开始日期(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="促销价格结束日期(数字0：未插入)" prop="promoteEndUtc">
        <el-input v-model="dataForm.promoteEndUtc" placeholder="促销价格结束日期(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="促销价格(数字0：未插入)" prop="promotePrice">
        <el-input v-model="dataForm.promotePrice" placeholder="促销价格(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="购买该商品可以使用的消费积分数量(数字0：未插入，1.未启用,2：启用，)" prop="integral">
        <el-input v-model="dataForm.integral" placeholder="购买该商品可以使用的消费积分数量(数字0：未插入，1.未启用,2：启用，)"></el-input>
      </el-form-item>
      <el-form-item label="是否包含红包，是否可以使用红包，购买该商品可以使用的红包金额，首先是可以使用红包的商品，其次达到一定额度(数字0：未插入，1.未启用,2：启用，)" prop="isBonus">
        <el-input v-model="dataForm.isBonus" placeholder="是否包含红包，是否可以使用红包，购买该商品可以使用的红包金额，首先是可以使用红包的商品，其次达到一定额度(数字0：未插入，1.未启用,2：启用，)"></el-input>
      </el-form-item>
      <el-form-item label="购买该商品时每笔成功交易赠送的消费积分数量(数字0：未插入，1.未启用,2：启用，)" prop="giveIntegral">
        <el-input v-model="dataForm.giveIntegral" placeholder="购买该商品时每笔成功交易赠送的消费积分数量(数字0：未插入，1.未启用,2：启用，)"></el-input>
      </el-form-item>
      <el-form-item label="购买该商品时每笔成功交易赠送的等级积分数量(数字0：未插入，1.未启用,2：启用，)" prop="rankIntegral">
        <el-input v-model="dataForm.rankIntegral" placeholder="购买该商品时每笔成功交易赠送的等级积分数量(数字0：未插入，1.未启用,2：启用，)"></el-input>
      </el-form-item>
      <el-form-item label="购买该商品时每笔成功交易赠送的红包类型(数字0：未插入，1.未启用,2：启用，)" prop="bonusTypeId">
        <el-input v-model="dataForm.bonusTypeId" placeholder="购买该商品时每笔成功交易赠送的红包类型(数字0：未插入，1.未启用,2：启用，)"></el-input>
      </el-form-item>
      <el-form-item label="是否需要邮递(数字0：未插入，1.是,2：否，)" prop="isShipping">
        <el-input v-model="dataForm.isShipping" placeholder="是否需要邮递(数字0：未插入，1.是,2：否，)"></el-input>
      </el-form-item>
      <el-form-item label="商品点击数即浏览量(数字0：未插入)" prop="clickCount">
        <el-input v-model="dataForm.clickCount" placeholder="商品点击数即浏览量(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="是否是精品；(数字0：未插入，1.是,2：否，)" prop="isBest">
        <el-input v-model="dataForm.isBest" placeholder="是否是精品；(数字0：未插入，1.是,2：否，)"></el-input>
      </el-form-item>
      <el-form-item label="是否是新品；(数字0：未插入，1.是,2：否，)" prop="isNew">
        <el-input v-model="dataForm.isNew" placeholder="是否是新品；(数字0：未插入，1.是,2：否，)"></el-input>
      </el-form-item>
      <el-form-item label="是否是热销；(数字0：未插入，1.是,2：否，)" prop="isHot">
        <el-input v-model="dataForm.isHot" placeholder="是否是热销；(数字0：未插入，1.是,2：否，)"></el-input>
      </el-form-item>
      <el-form-item label="商品状态；(数字0：未插入，1.待上架,2：已上架，3：已下架等)" prop="status">
        <el-input v-model="dataForm.status" placeholder="商品状态；(数字0：未插入，1.待上架,2：已上架，3：已下架等)"></el-input>
      </el-form-item>
      <el-form-item label="商品评价平均分数即评分；(数字0：未插入，1.待上架,2：已上架，3：已下架等)" prop="score">
        <el-input v-model="dataForm.score" placeholder="商品评价平均分数即评分；(数字0：未插入，1.待上架,2：已上架，3：已下架等)"></el-input>
      </el-form-item>
      <el-form-item label="商品的商家备注，仅商家可见(字符串空：未插入)" prop="sellerNote">
        <el-input v-model="dataForm.sellerNote" placeholder="商品的商家备注，仅商家可见(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="操作员(字符串空：未插入)" prop="operator">
        <el-input v-model="dataForm.operator" placeholder="操作员(字符串空：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="创建即上传时间(数字0：未插入)" prop="createUtc">
        <el-input v-model="dataForm.createUtc" placeholder="创建即上传时间(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="修改即更新时间(数字0：未插入)" prop="modifyUtc">
        <el-input v-model="dataForm.modifyUtc" placeholder="修改即更新时间(数字0：未插入)"></el-input>
      </el-form-item>
      <el-form-item label="是否删除(数字0：未插入，1.未删除,2：删除，)" prop="isDeleted">
        <el-input v-model="dataForm.isDeleted" placeholder="是否删除(数字0：未插入，1.未删除,2：删除，)"></el-input>
      </el-form-item>
      <el-form-item label="版本号(数字0：未插入)" prop="version">
        <el-input v-model="dataForm.version" placeholder="版本号(数字0：未插入)"></el-input>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
  </el-dialog>
</template>

<script>
  import API from '@/api'
  export default {
    data () {
      return {
        visible: false,
        dataForm: {
          id: 0,
          catId: '',
          brandId: '',
          userId: '',
          goodsSn: '',
          goodsName: '',
          isReal: '',
          goodsBrief: '',
          goodsDesc: '',
          goodsThumb: '',
          goodsImg: '',
          originalImg: '',
          goodsAdress: '',
          goodsFormat: '',
          goodsCity: '',
          goodsWeight: '',
          goodsNumber: '',
          isOnSale: '',
          isAloneSale: '',
          marketPrice: '',
          shopPrice: '',
          memberPrice: '',
          isPromote: '',
          promoteStartUtc: '',
          promoteEndUtc: '',
          promotePrice: '',
          integral: '',
          isBonus: '',
          giveIntegral: '',
          rankIntegral: '',
          bonusTypeId: '',
          isShipping: '',
          clickCount: '',
          isBest: '',
          isNew: '',
          isHot: '',
          status: '',
          score: '',
          sellerNote: '',
          operator: '',
          createUtc: '',
          modifyUtc: '',
          isDeleted: '',
          version: ''
        },
        dataRule: {
          catId: [
            { required: true, message: '商品所属商品分类ID，取值CATEGORY的ID(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          brandId: [
            { required: true, message: '品牌ID，取值于BRAND 的BRAND_ID(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          userId: [
            { required: true, message: '商家ID即组织ID即店铺ID即卖家ID(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          goodsSn: [
            { required: true, message: '商品的唯一货号(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          goodsName: [
            { required: true, message: '商品的名称(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          isReal: [
            { required: true, message: '是否是实物；比如虚拟卡不是实物(数字0：未插入，1.是,2：否，)不能为空', trigger: 'blur' }
          ],
          goodsBrief: [
            { required: true, message: '商品的简短描述(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          goodsDesc: [
            { required: true, message: '商品的详细描述(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          goodsThumb: [
            { required: true, message: '商品在前台显示的微缩图片，如在分类筛选时显示的小图片(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          goodsImg: [
            { required: true, message: '商品的实际大小图片，如进入该商品页时介绍商品属性所显示的大图片(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          originalImg: [
            { required: true, message: '上传的商品的原始图片(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          goodsAdress: [
            { required: true, message: '商品的产地(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          goodsFormat: [
            { required: true, message: '商品的规格(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          goodsCity: [
            { required: true, message: '商品的城市；只有培训会有城市，且需要城市字典表用于前段显示(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          goodsWeight: [
            { required: true, message: '商品的重量，以千克为单位(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          goodsNumber: [
            { required: true, message: '商品库存数量(数字0：未插入，1.是,2：否，)不能为空', trigger: 'blur' }
          ],
          isOnSale: [
            { required: true, message: '该商品是否开放销售(数字0：未插入，1.是,2：否，)不能为空', trigger: 'blur' }
          ],
          isAloneSale: [
            { required: true, message: '是否能单独销售；如果不能单独销售，则只能作为某商品的配件或者赠品销售(数字0：未插入，1.是,2：否，)不能为空', trigger: 'blur' }
          ],
          marketPrice: [
            { required: true, message: '市场售价(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          shopPrice: [
            { required: true, message: '本店售价(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          memberPrice: [
            { required: true, message: '会员售价(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          isPromote: [
            { required: true, message: '是否特价促销(数字0：未插入，1.是,2：否，)不能为空', trigger: 'blur' }
          ],
          promoteStartUtc: [
            { required: true, message: '促销价格开始日期(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          promoteEndUtc: [
            { required: true, message: '促销价格结束日期(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          promotePrice: [
            { required: true, message: '促销价格(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          integral: [
            { required: true, message: '购买该商品可以使用的消费积分数量(数字0：未插入，1.未启用,2：启用，)不能为空', trigger: 'blur' }
          ],
          isBonus: [
            { required: true, message: '是否包含红包，是否可以使用红包，购买该商品可以使用的红包金额，首先是可以使用红包的商品，其次达到一定额度(数字0：未插入，1.未启用,2：启用，)不能为空', trigger: 'blur' }
          ],
          giveIntegral: [
            { required: true, message: '购买该商品时每笔成功交易赠送的消费积分数量(数字0：未插入，1.未启用,2：启用，)不能为空', trigger: 'blur' }
          ],
          rankIntegral: [
            { required: true, message: '购买该商品时每笔成功交易赠送的等级积分数量(数字0：未插入，1.未启用,2：启用，)不能为空', trigger: 'blur' }
          ],
          bonusTypeId: [
            { required: true, message: '购买该商品时每笔成功交易赠送的红包类型(数字0：未插入，1.未启用,2：启用，)不能为空', trigger: 'blur' }
          ],
          isShipping: [
            { required: true, message: '是否需要邮递(数字0：未插入，1.是,2：否，)不能为空', trigger: 'blur' }
          ],
          clickCount: [
            { required: true, message: '商品点击数即浏览量(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          isBest: [
            { required: true, message: '是否是精品；(数字0：未插入，1.是,2：否，)不能为空', trigger: 'blur' }
          ],
          isNew: [
            { required: true, message: '是否是新品；(数字0：未插入，1.是,2：否，)不能为空', trigger: 'blur' }
          ],
          isHot: [
            { required: true, message: '是否是热销；(数字0：未插入，1.是,2：否，)不能为空', trigger: 'blur' }
          ],
          status: [
            { required: true, message: '商品状态；(数字0：未插入，1.待上架,2：已上架，3：已下架等)不能为空', trigger: 'blur' }
          ],
          score: [
            { required: true, message: '商品评价平均分数即评分；(数字0：未插入，1.待上架,2：已上架，3：已下架等)不能为空', trigger: 'blur' }
          ],
          sellerNote: [
            { required: true, message: '商品的商家备注，仅商家可见(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          operator: [
            { required: true, message: '操作员(字符串空：未插入)不能为空', trigger: 'blur' }
          ],
          createUtc: [
            { required: true, message: '创建即上传时间(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          modifyUtc: [
            { required: true, message: '修改即更新时间(数字0：未插入)不能为空', trigger: 'blur' }
          ],
          isDeleted: [
            { required: true, message: '是否删除(数字0：未插入，1.未删除,2：删除，)不能为空', trigger: 'blur' }
          ],
          version: [
            { required: true, message: '版本号(数字0：未插入)不能为空', trigger: 'blur' }
          ]
        }
      }
    },
    methods: {
      init (id) {
        this.dataForm.id = id || 0
        this.visible = true
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          if (this.dataForm.id) {
            API.upkgoods.info(this.dataForm.id).then(({data}) => {
              if (data && data.code === 0) {
                this.dataForm.catId = data.upkgoods.catId
                this.dataForm.brandId = data.upkgoods.brandId
                this.dataForm.userId = data.upkgoods.userId
                this.dataForm.goodsSn = data.upkgoods.goodsSn
                this.dataForm.goodsName = data.upkgoods.goodsName
                this.dataForm.isReal = data.upkgoods.isReal
                this.dataForm.goodsBrief = data.upkgoods.goodsBrief
                this.dataForm.goodsDesc = data.upkgoods.goodsDesc
                this.dataForm.goodsThumb = data.upkgoods.goodsThumb
                this.dataForm.goodsImg = data.upkgoods.goodsImg
                this.dataForm.originalImg = data.upkgoods.originalImg
                this.dataForm.goodsAdress = data.upkgoods.goodsAdress
                this.dataForm.goodsFormat = data.upkgoods.goodsFormat
                this.dataForm.goodsCity = data.upkgoods.goodsCity
                this.dataForm.goodsWeight = data.upkgoods.goodsWeight
                this.dataForm.goodsNumber = data.upkgoods.goodsNumber
                this.dataForm.isOnSale = data.upkgoods.isOnSale
                this.dataForm.isAloneSale = data.upkgoods.isAloneSale
                this.dataForm.marketPrice = data.upkgoods.marketPrice
                this.dataForm.shopPrice = data.upkgoods.shopPrice
                this.dataForm.memberPrice = data.upkgoods.memberPrice
                this.dataForm.isPromote = data.upkgoods.isPromote
                this.dataForm.promoteStartUtc = data.upkgoods.promoteStartUtc
                this.dataForm.promoteEndUtc = data.upkgoods.promoteEndUtc
                this.dataForm.promotePrice = data.upkgoods.promotePrice
                this.dataForm.integral = data.upkgoods.integral
                this.dataForm.isBonus = data.upkgoods.isBonus
                this.dataForm.giveIntegral = data.upkgoods.giveIntegral
                this.dataForm.rankIntegral = data.upkgoods.rankIntegral
                this.dataForm.bonusTypeId = data.upkgoods.bonusTypeId
                this.dataForm.isShipping = data.upkgoods.isShipping
                this.dataForm.clickCount = data.upkgoods.clickCount
                this.dataForm.isBest = data.upkgoods.isBest
                this.dataForm.isNew = data.upkgoods.isNew
                this.dataForm.isHot = data.upkgoods.isHot
                this.dataForm.status = data.upkgoods.status
                this.dataForm.score = data.upkgoods.score
                this.dataForm.sellerNote = data.upkgoods.sellerNote
                this.dataForm.operator = data.upkgoods.operator
                this.dataForm.createUtc = data.upkgoods.createUtc
                this.dataForm.modifyUtc = data.upkgoods.modifyUtc
                this.dataForm.isDeleted = data.upkgoods.isDeleted
                this.dataForm.version = data.upkgoods.version
              }
            })
          }
        })
      },
      // 表单提交
      dataFormSubmit () {
        this.$refs['dataForm'].validate((valid) => {
          if (valid) {
            var params = {
              'id': this.dataForm.id || undefined,
              'catId': this.dataForm.catId,
              'brandId': this.dataForm.brandId,
              'userId': this.dataForm.userId,
              'goodsSn': this.dataForm.goodsSn,
              'goodsName': this.dataForm.goodsName,
              'isReal': this.dataForm.isReal,
              'goodsBrief': this.dataForm.goodsBrief,
              'goodsDesc': this.dataForm.goodsDesc,
              'goodsThumb': this.dataForm.goodsThumb,
              'goodsImg': this.dataForm.goodsImg,
              'originalImg': this.dataForm.originalImg,
              'goodsAdress': this.dataForm.goodsAdress,
              'goodsFormat': this.dataForm.goodsFormat,
              'goodsCity': this.dataForm.goodsCity,
              'goodsWeight': this.dataForm.goodsWeight,
              'goodsNumber': this.dataForm.goodsNumber,
              'isOnSale': this.dataForm.isOnSale,
              'isAloneSale': this.dataForm.isAloneSale,
              'marketPrice': this.dataForm.marketPrice,
              'shopPrice': this.dataForm.shopPrice,
              'memberPrice': this.dataForm.memberPrice,
              'isPromote': this.dataForm.isPromote,
              'promoteStartUtc': this.dataForm.promoteStartUtc,
              'promoteEndUtc': this.dataForm.promoteEndUtc,
              'promotePrice': this.dataForm.promotePrice,
              'integral': this.dataForm.integral,
              'isBonus': this.dataForm.isBonus,
              'giveIntegral': this.dataForm.giveIntegral,
              'rankIntegral': this.dataForm.rankIntegral,
              'bonusTypeId': this.dataForm.bonusTypeId,
              'isShipping': this.dataForm.isShipping,
              'clickCount': this.dataForm.clickCount,
              'isBest': this.dataForm.isBest,
              'isNew': this.dataForm.isNew,
              'isHot': this.dataForm.isHot,
              'status': this.dataForm.status,
              'score': this.dataForm.score,
              'sellerNote': this.dataForm.sellerNote,
              'operator': this.dataForm.operator,
              'createUtc': this.dataForm.createUtc,
              'modifyUtc': this.dataForm.modifyUtc,
              'isDeleted': this.dataForm.isDeleted,
              'version': this.dataForm.version
            }
            var tick = !this.dataForm.id ? API.upkgoods.add(params) : API.upkgoods.update(params)
            tick.then(({data}) => {
              if (data && data.code === 0) {
                this.$message({
                  message: '操作成功',
                  type: 'success',
                  duration: 1500,
                  onClose: () => {
                    this.visible = false
                    this.$emit('refreshDataList')
                  }
                })
              } else {
                this.$message.error(data.msg)
              }
            })
          }
        })
      }
    }
  }
</script>
